{
  let num: number = 100

  let obj1 = { name: '小花', age: 18 }
  // ts中定义对象，是指对象的格式。
  // 约定一下，这个对象有两个属性： name(string), age(number)

  let obj2: { address: number, name: string, age: number } = { name: '小花', age: 18, address: 1 }
  let obj3: { address: number, name: string, age: number } = { name: '小花花', age: 17, address: 2 }
}

  // obj2.name = 1

  // 自定义类型
  type MyGirl = { 
    address: number
    name: string 
    age: number
    // hello的类型，是一个函数，没有形参，返回一个string
    hello: () => string // hello: () => {}
    greet(): void,   //  greet:function(){}
  }

  let g1: MyGirl = {
    greet: function(){

    },
    hello: function(){
      return 'abc'
    },
    age: 18,
    name: '小花',
    address: 0
  }

  let g2: MyGirl = {
    age: 18,
    name: '小花',
    address: 0
  }

  const fn = (g: MyGirl) => {
    g. // 就可以有提示啦
  }
